<template>
  <el-row :gutter="20">
    <el-col :span="4">
      <!--      <div class="grid-content bg-purple"></div>-->
      <category-tree @click-third-level-category="updateCategoryNode($event)" :hub="hub"></category-tree>
    </el-col>
    <el-col :span="20">
      <!--      <div class="grid-content bg-purple"></div>-->
      <attr-group-auto-generate :hub="hub"></attr-group-auto-generate>
    </el-col>
  </el-row>
</template>

<script>
import categoryTree from '../common/categoryTree'
import attrGroupAutoGenerate from './attrGroupComponent/attrgroup-auto-generate'
import Vue from 'vue'


export default {
  name: 'attrgroupParent',
  components: {
    'category-tree': categoryTree,
    'attr-group-auto-generate':attrGroupAutoGenerate
  },
  data () {
    return {
      currentPage: 1,
      size: 10,
      hub: null, // 创建事件中心，用于兄弟组件通信，不能在这里直接 hub: new Vue() 这样无法传递到子组件中
    }
  },
  methods: {
    updateCategoryNode (node) {
      //console.log('当前点击的节点是', node)
    },

  },
  mounted () {
    this.hub = new Vue();
    // console.log("父组件中的hub是",this.hub)
  }
}
</script>

<style scoped>

</style>
